#ifndef BULLET_H
#define BULLET_H

#include <QPainter>
#include <QPixmap>
#include "asteroid.h"

class Bullet
{
public:
    Bullet(qreal x, qreal y, qreal dirX, qreal dirY);
    ~Bullet();

    void draw(QPainter *painter);
    void move();
    bool isOutOfField(qint32 width, qint32 height);
    bool intersects(Asteroid *asteroid);


private:
    static const qreal m_speed;

    QPixmap m_pixmap;

    qreal m_x;
    qreal m_y;
    qreal m_dirX;
    qreal m_dirY;
};

#endif // BULLET_H
